<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Sign in &middot; Linda Investment System</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ricardo">

    <!-- Le styles -->
    <link href="<c:url value="/css/bootstrap.min.css" />" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 40px;
        padding-bottom: 40px;
        background-color: #f5f5f5;
      }

      .form-signin {
        max-width: 300px;
        padding: 19px 29px 29px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .form-signin .form-signin-heading,
      .form-signin .checkbox {
        margin-bottom: 10px;
      }
      .form-signin input[type="text"],
      .form-signin input[type="password"] {
        font-size: 16px;
        height: auto;
        margin-bottom: 15px;
        padding: 7px 9px;
      }

    </style>
    
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="//cdnjs.bootcss.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
    <![endif]-->

    
  </head>

  <body>

    <div class="container">
    	
		<form class="form-signin" action='<c:url value="/login" />' method="post" id="loginForm">
        <h2 class="form-signin-heading">Please sign in</h2>
        <!-- error message -->
		<c:if test="${message != null }">
			<div class="alert alert-error">
				<c:out value="${message }" />
			</div>
		</c:if>
        <input type="text" class="input-block-level" placeholder="Email address" name="userName">
        <input type="password" class="input-block-level" placeholder="Password" name="password">
        <button class="btn btn-large btn-primary" type="submit">Sign in</button>
      </form>

    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="<c:url value="/js/jquery-1.10.2.min.js" />"></script>
    <script src="<c:url value="/js/bootstrap.min.js" />"></script>
    <script src="<c:url value="/js/jquery.validate.min.js" />"></script>
    <script src="<c:url value="/js/jquery.validate.min.js" />"></script>
    
    <script type="text/javascript">
    $(document).ready(function(){   
    	//defaults
    	$.validator.setDefaults({
    		submitHandler: function(form) {    
    			form.submit();    
    		}
    	});
    	
    	//begin to validate
    	$('#loginForm').validate({  
    		rules: {
    			userName:{
    				required:true
    			},
    			password:{
    				required:true
    			}
    		},
    		messages:{
    			userName: {       
    				required:"请填写用户名"
    			},
    			password:{
    				required:"请填写用户密码"
    			}
    		}
    	});
    });
    
    </script>

  </body>
</html>
